refactor: clean-up code related to feature flags#3901
Conversation
There was a problem hiding this comment.
Pull request overview
Removes legacy feature-flag-controlled code paths for iOS behaviors whose defaults have already been flipped to true, simplifying the JS/native surface area and native implementations.
Changes:
- Removed the three experimental flags from internal flag storage/accessors and from Fabric native component prop specs.
- Simplified JS components and native iOS/Android view managers by deleting now-dead plumbing around those flags.
- Removed iOS interaction-disabling helper implementation that existed only to support the deprecated transition-interaction behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/flags.ts | Removes internal storage/accessors for the deprecated flags; keeps API via deprecated getters that always return true. |
| src/fabric/ScreenStackNativeComponent.ts | Removes deprecated iOS-only props from the Fabric codegen spec. |
| src/fabric/ScreenNativeComponent.ts | Removes deprecated iOS-only prop from the Fabric codegen spec. |
| src/components/ScreenStack.tsx | Stops passing deprecated iOS reattachment props into the native component. |
| src/components/Screen.tsx | Removes deprecated transition flag warning and stops passing the deprecated prop to the native component. |
| ios/helpers/RNSViewInteractionManager.mm | Deleted (no longer needed once the flag-controlled behavior is removed). |
| ios/helpers/RNSViewInteractionManager.h | Deleted (no longer needed once the flag-controlled behavior is removed). |
| ios/helpers/RNSViewInteractionAware.h | Deleted (no longer needed once the flag-controlled behavior is removed). |
| ios/RNSScreenStack.mm | Removes flag-driven branching and associated interaction-sinking logic; behavior becomes unconditional. |
| ios/RNSScreenStack.h | Removes public properties for the removed flags. |
| ios/RNSScreen.mm | Removes interaction manager usage tied to the removed transition flag. |
| ios/RNSScreen.h | Removes the interaction manager import and shared-instance API. |
| android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt | Removes no-op setter override for the removed iOS-only prop. |
| android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt | Removes no-op setter overrides for removed iOS-only props. |
| FabricExample/App.tsx | Removes example configuration lines for the removed flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree]; | ||
| } | ||
|
|
||
| // NOTE(kkafar): We should consider depracating the use of gesture cancel here & align |
There was a problem hiding this comment.
Typo in comment: "depracating" should be "deprecating".
| // NOTE(kkafar): We should consider depracating the use of gesture cancel here & align | |
| // NOTE(kkafar): We should consider deprecating the use of gesture cancel here & align |
kkafar
left a comment
There was a problem hiding this comment.
Looks good!
I've got only a single remark regarding comments.
| * Disables the behavior that blocks interactions during Stack Screen transition. | ||
| * The application should immediately react to user gestures, dismissing more screens at once, etc. | ||
| * Use only with `iosPreventReattachmentOfDismissedScreens = true` to enable the fix | ||
| * for native / JS state desynchronization. On by default. | ||
| * PR: https://github.com/software-mansion/react-native-screens/pull/3631 |
There was a problem hiding this comment.
I think that descriptions of what did particular flag did should stay in place as long as we don't remove the flag completely.
Description
Following flags:
iosPreventReattachmentOfDismissedScreens,iosPreventReattachmentOfDismissedModals,ios26AllowInteractionsDuringTransitionhad their default values changed totruein prior releases and they are not needed anymore. This PR removes the dead code paths that supported the oldfalsebehaviour.Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1061
Changes
Before & after - visual documentation
N/A
Test plan
Build the app.
Checklist